package cn.com.note.activity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import cn.com.note.R;
import cn.com.note.utils.glide.GlideUtils;

/**
 * Created by SunFuLin on 2019/4/23.
 */

public class LoadImgActivity extends AppCompatActivity {
    ImageView iv1_1, iv1_2, iv1_3, iv1_4;
    ImageView iv2_1, iv2_2, iv2_3, iv2_4;
    ImageView iv3_1, iv3_2, iv3_3, iv3_4;
    private String imageUrl = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1555999032277&di=5f6bbbee537d5280b6d3e50b0b6fb47b&imgtype=0&src=http%3A%2F%2Fimgcache.cjmx.com%2Fstar%2F201604%2F20160419235206823.jpg";

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_load_img);
        initView();

        loadImg();
    }

    private void loadImg() {
        GlideUtils.LoadIV_Url(iv1_1,imageUrl);
        GlideUtils.LoadCircleIV(iv1_2,imageUrl);
        GlideUtils.LoadCrossFadeIV(iv1_3,imageUrl);
    }

    private void initView() {
        iv1_1 = findViewById(R.id.iv1_1);
        iv1_2 = findViewById(R.id.iv1_2);
        iv1_3 = findViewById(R.id.iv1_3);
        iv1_4 = findViewById(R.id.iv1_4);
        iv2_1 = findViewById(R.id.iv2_1);
        iv2_2 = findViewById(R.id.iv2_2);
        iv2_3 = findViewById(R.id.iv2_3);
        iv2_4 = findViewById(R.id.iv2_4);
        iv3_1 = findViewById(R.id.iv3_1);
        iv3_2 = findViewById(R.id.iv3_2);
        iv3_3 = findViewById(R.id.iv3_3);
        iv3_4 = findViewById(R.id.iv3_4);
    }
}
